<%@ page language="java" contentType="text/html;charset=UTF-8" %>

<HTML>
<HEAD><TITLE>后台操作区</TITLE>
    <LINK href="../../../static/css/member/Admin_Style.css" type=text/css rel=stylesheet>
    <LINK href="../../../static/css/member/style.css" type=text/css rel=stylesheet>
    <SCRIPT language=JavaScript src="../../../static/js/member/Common.js"></SCRIPT>
    <script src="../../../static/js/jquery-1.8.3.js"></script>
    <STYLE type=text/css>
        BODY {
            MARGIN-LEFT: 0px;
            BACKGROUND-COLOR: #ffffff
        }

        .STYLE1 {
            color: #ECE9D8
        }
    </STYLE>
</HEAD>
<script>
    $(function () {
        getHyList();
    })
    function getHyList(pageIndex){
        $(".hyList").empty();
        $(".hyPage").empty();
        $.ajax({
            url:"/hy/getPage",//请求地址
            type:"post",//请求类型（get/post）
            data:{"pageIndex":pageIndex||1},//当pageIndex为空选择1
            dataType:"json",//相应数据类型
            success:function (data) {//data表示请求成功返回的数据
                for (var i=0;i<data.list.length;i++){
                    $(".hyList").append(
                        "<tr class=\"trA\" onMouseOver=\"this.className='trB'\" onMouseOut=\"this.className='trA'\">\n" +
                        "                    <td width='5%' align=\"center\" style=\"border-bottom:1px dotted #ccc;\">"+(i+1)+"" +
                        "                    </td>\n" +
                        "                    <td align=\"center\" bgcolor=\"#FFFFFF\"\n" +
                        "                        style=\"border-bottom:1px dotted #ccc;\">"+data.list[i].xm+"\n" +
                        "                    </td>\n" +
                        "                    <td align=\"center\" bgcolor=\"#FFFFFF\"\n" +
                        "                        style=\"border-bottom:1px dotted #ccc;\">"+data.list[i].xb+"\n" +
                        "                    </td>\n" +
                        "                    <td align=\"center\" bgcolor=\"#FFFFFF\"\n" +
                        "                        style=\"border-bottom:1px dotted #ccc;\">"+data.list[i].cs+"\n" +
                        "                    </td>\n" +
                        "                    <td align=\"center\" bgcolor=\"#FFFFFF\"\n" +
                        "                       style=\"border-bottom:1px dotted #ccc;\">"+data.list[i].fm+"\n" +
                        "                    <td align=\"center\" bgcolor=\"#FFFFFF\"\n" +
                        "                        style=\"border-bottom:1px dotted #ccc;\">"+data.list[i].zz+"\n" +
                        "                    </td>\n" +
                        "                    <td align=\"center\" bgcolor=\"#FFFFFF\"\n" +
                        "                        style=\"border-bottom:1px dotted #ccc;\">"+data.list[i].dh+"\n" +
                        "                    </td>\n" +
                        "                    <td align=\"center\" bgcolor=\"#FFFFFF\"\n" +
                        "                        style=\"border-bottom:1px dotted #ccc;\">"+data.list[i].yx+"\n" +
                        "                    </td>\n" +
                        "                    <td align=\"center\" bgcolor=\"#FFFFFF\" style=\"border-bottom:1px dotted #ccc;\">\n" +
                        "                        <a href=\"../hy/add.jsp\">修改</a>\n" +
                        "                    </td>\n" +
                        "                    <td align=\"center\" bgcolor=\"#FFFFFF\" style=\"border-bottom:1px dotted #ccc;\">\n" +
                        "                        <a href=\"#\">删除</a></td>\n" +
                        "                </tr>")
                }
                //显示页码数
                $(".hyPage").append("  <TR align=\"right\">\n" +
                    "                    <TD>\n" +
                    "                        <form action=\"\" method=\"post\" name=\"form3\">\n" +
                    "                            <input type=\"hidden\" name=\"pageCount\"\n" +
                    "                                   value=\"#\"/>\n" +
                    "                            <!--//用于给上面javascript传值-->\n" +
                    "                            <input type=\"hidden\" name=\"page\" value=\"#\"/>\n" +
                    "                            <!--//用于给上面javascript传值-->\n" +
                    "                            <a href=\"#\" onClick=\"shouye()\"><img src=\"../../../static/images/first.gif\" border=\"0\"/></a>&nbsp;&nbsp;&nbsp;\n" +
                    "                            <a href=\"#\" onClick=\"up("+data.pageIndex+")\"><img src=\"../../../static/images/pre.gif\" border=\"0\"/></a>&nbsp;&nbsp;&nbsp;\n" +
                    "                            共"+data.totalCount+"\n" +
                    "                            条记录,共计"+data.totalPageCount+"\n" +
                    "                            页,当前第"+data.pageIndex+"页&nbsp;&nbsp;&nbsp;\n" +
                    "                            <a href=\"#\" onClick=\"next("+data.pageIndex+")\"><img src=\"../../../static/images/next.gif\" border=\"0\"/></a>&nbsp;&nbsp;&nbsp;\n" +
                    "                            <a href=\"#\" onClick=\"weiye("+data.totalPageCount+")\"><img src=\"../../../static/images/last.gif\" border=\"0\"/></a>\n" +
                    "                            第<input id=\"busjump\" type=\"text\" size=\"3\"/>页<a href=\"#\" onClick=\"bjump()\"><img\n" +
                    "                                src=\"../../../static/images/jump.gif\" border=\"0\"/></a>&nbsp;&nbsp;&nbsp;\n" +
                    "                        </form>\n" +
                    "                    </TD>\n" +
                    "                </TR>")
            }
        })
    }
    //上一页
    function up(pageIdex) {
        getHyList((pageIdex-1));
    }
    //下一页
    function next(pageIdex) {
        getHyList((pageIdex+1));
    }
    //首页
    function shouye() {
        getHyList(1);
    }
    //尾页
    function weiye(totalPageCount) {
        getHyList(totalPageCount);
    }
    //跳转页面
    function bjump() {
        var pageIndex=$("#busjump").val();
        getHyList(pageIndex);
    }
</script>
<BODY>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
    <TBODY>
    <TR>
        <TD align="left" vAlign=top>
            <table width='100%' cellspacing='1' cellpadding='3' bgcolor='#CCCCCC' class="tablewidth">
                <tr class="head">
                    <td width="5%" align="center">ID</td>
                    <td align="center">会员姓名</td>
                    <td align="center">会员性别</td>
                    <td align="center">身份证号码</td>
                    <td align="center">会员生日</td>
                    <td align="center">家庭住址</td>
                    <td align="center">联系电话</td>
                    <td align="center">邮箱</td>
                    <td align="center">修改</td>
                    <td align="center">删除</td>
                </tr>
                <tbody class="hyList">
<%--                显示数据--%>

                </tbody>
            </TABLE>
        </td>
    </tr>
    <tr bgcolor='#FFFFFF'>
        <td colspan='10' align='right'>
            <TABLE width="100%" border=0 align="right" cellPadding=0 cellSpacing=0>
                <TBODY class="hyPage">

            </table>
        </TD>
    </TR>
    </TBODY>
</TABLE>
</BODY>
</HTML>
